<template>
  <div>
    <div class="container">
      <div class="handle-box">
        <el-select v-model="query.case_source" @change="handleSearch(query.case_number,query.tcs_note_id,query.case_source,query.case_type)" clearable placeholder="案件来源" class="handle-select mr10">
          <el-option key="1" label="市场查获" value="市场查获"></el-option>
          <el-option key="2" label="投诉举报" value="投诉举报"></el-option>
          <el-option key="3" label="上级交办" value="上级交办"></el-option>
        </el-select>
        <el-select v-model="query.case_type" @change="handleSearch(query.case_number,query.tcs_note_id,query.case_source,query.case_type)" clearable placeholder="案件性质" class="handle-select mr10">
          <el-option key="1" label="一般案件" value="一般案件"></el-option>
          <el-option key="2" label="简易案件" value="简易案件"></el-option>
        </el-select>
        <el-input v-model="query.case_number" placeholder="立案编号" @change="handleSearch(query.case_number,query.tcs_note_id,query.case_source,query.case_type)" class="handle-input mr10"></el-input>
        <el-button type="primary" :icon="Search" @change="handleSearch(query.case_number,query.tcs_note_id,query.case_source,query.case_type)">搜索</el-button>
      </div>
      <el-table :data="tableList" border class="table" ref="multipleTable" header-cell-class-name="table-header">
        <!--        <el-table-column prop="case_id" label="案件号" width="100" align="center"></el-table-column>-->
        <el-table-column prop="case_source" label="案件来源" align="center"></el-table-column>
        <el-table-column prop="case_number" label="立案编号" width="200" align="center"></el-table-column>
        <el-table-column prop="case_update_time" label="更新时间"  align="center"></el-table-column>
        <el-table-column prop="case_type" label="案件性质" align="center"></el-table-column>
        <el-table-column prop="date_of_filing" label="立案日期"  align="center"></el-table-column>
        <el-table-column label="卷烟鉴别状态" align="center" width="180">
          <template #default="scope">
            <div v-if="scope.row.tcs_note_id === '立案报告表审核已完成'" >
              <el-tag :type=" 'danger'">立案报告表审核已完成 </el-tag>
            </div>
            <div v-if="scope.row.tcs_note_id === '卷烟鉴别书已送检'" >
              <el-tag :type=" 'danger'">已送检 </el-tag>
            </div>
            <div v-if="scope.row.tcs_note_id === '卷烟鉴别抽样单填写开始'" >
              <el-tag :type=" 'warning'">卷烟鉴别抽样单填写开始 </el-tag>
            </div>
            <div v-if="scope.row.tcs_note_id === '卷烟鉴别委托书填写开始'" >
              <el-tag :type=" 'warning'">卷烟鉴别委托书填写开始 </el-tag>
            </div>
            <div v-if="scope.row.tcs_note_id === '上传送检结果开始'" >
              <el-tag :type=" 'warning'">上传送检结果开始 </el-tag>
            </div>

            <div v-if="scope.row.tcs_note_id === '卷烟鉴别书已完成' ||
            scope.row.tcs_note_id === '涉案烟草价品核案表完成' ||
            scope.row.tcs_note_id === '询问笔录已完成' ||
            scope.row.tcs_note_id === '已完成' ||
            scope.row.tcs_note_id === '无证经营公示已完成' ||
            scope.row.tcs_note_id ==='调查终结文书已完成'||
            scope.row.tcs_note_id ==='案件处理审批已开始'||
            scope.row.tcs_note_id ==='集体讨论已开始'||
            scope.row.tcs_note_id ==='集体讨论已完成'||
            scope.row.tcs_note_id ==='听证已开始'||
            scope.row.tcs_note_id ==='听证告知书已完成'||
            scope.row.tcs_note_id ==='听证已完成'||
            scope.row.tcs_note_id ==='案件处理审批已完成'||
            scope.row.tcs_note_id ==='行政处罚事先告知书确认完成'||
            scope.row.tcs_note_id ==='行政处罚事先告知书已完成'||
            scope.row.tcs_note_id ==='行政处罚决定书确认完成'||
            scope.row.tcs_note_id ==='行政处罚决定书已完成'||
            scope.row.tcs_note_id ==='行政罚款收据上传完成'||
            scope.row.tcs_note_id ==='行政罚款收据已完成'||
            scope.row.tcs_note_id ==='结案报告表已完成'" >
              <el-tag :type=" 'success'">已完成 </el-tag>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="操 作" width="300" align="center">
          <template #default="scope">
            <div v-if="scope.row.tcs_note_id === '立案报告表审核已完成'" >
              <el-button text :icon="Edit" class="blue" @click="post_ciga_report(scope.row)" >
                送检卷烟
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '卷烟鉴别书已送检'" >
              <el-button text :icon="Edit" class="blue" @click="get_ciga_report(scope.row)" >
                卷烟鉴别
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '卷烟鉴别抽样单填写开始'" >
              <el-button text :icon="Edit" class="blue" @click="cigarette_identifify_sample(scope.row)" >
                卷烟鉴别抽样单填写
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '卷烟鉴别委托书填写开始'" >
              <el-button text :icon="Edit" class="blue" @click="cigarette_identifify_entrust(scope.row)" >
                卷烟鉴别委托书填写开始
              </el-button>
            </div>
            <div v-if="scope.row.tcs_note_id === '上传送检结果开始'" >
              <el-button text :icon="Edit" class="blue" @click="upload_inspection_result(scope.row)" >
                上传送检结果开始
              </el-button>
            </div>


            <div v-if="scope.row.tcs_note_id === '卷烟鉴别书已完成' ||
            scope.row.tcs_note_id === '涉案烟草价品核案表完成' ||
            scope.row.tcs_note_id === '询问笔录已完成' ||
            scope.row.tcs_note_id === '已完成' ||
            scope.row.tcs_note_id === '无证经营公示已完成' ||
            scope.row.tcs_note_id ==='调查终结文书已完成'||
            scope.row.tcs_note_id ==='案件处理审批已开始'||
            scope.row.tcs_note_id ==='集体讨论已开始'||
            scope.row.tcs_note_id ==='集体讨论已完成'||
            scope.row.tcs_note_id ==='听证已开始'||
            scope.row.tcs_note_id ==='听证告知书已完成'||
            scope.row.tcs_note_id ==='听证已完成'||
            scope.row.tcs_note_id ==='案件处理审批已完成'||
            scope.row.tcs_note_id ==='行政处罚事先告知书确认完成'||
            scope.row.tcs_note_id ==='行政处罚事先告知书已完成'||
            scope.row.tcs_note_id ==='行政处罚决定书确认完成'||
            scope.row.tcs_note_id ==='行政处罚决定书已完成'||
            scope.row.tcs_note_id ==='行政罚款收据上传完成'||
            scope.row.tcs_note_id ==='行政罚款收据已完成'||
            scope.row.tcs_note_id ==='结案报告表已完成'" >
              <el-button text :icon="Edit" class="blue" @click="view_ciga_report(scope.row)" >
                查看相关文件
              </el-button>
            </div>
          </template>
        </el-table-column>
      </el-table>
      <div class="pagination">
        <el-pagination
            background
            layout="total, prev, pager, next"
            :current-page="query.pageIndex"
            :page-size="query.pageSize"
            :total="pageTotal"
            @current-change="handlePageChange"
        ></el-pagination>
      </div>
    </div>


    <el-dialog title="送检" v-model="Post_identify_Visible" width="34%">
      <el-form label-width="140px">
        <el-form-item label="商户烟草售卖许可证" >
          <el-select v-model="case_identify_report_data.retail_licence_code"
                      filterable placeholder="请选择商户" :disabled="true">
            <el-option
                v-for="item in mer_Data"
                :key="item.mer_id"
                :label="item.retail_licence_code"
                :value="item.mer_id"
            >商户名称：{{item.mer_name}}</el-option>
          </el-select>
        </el-form-item>
          <el-form-item label="当事人姓名" >
            <el-input v-model="case_identify_report_data.tir_person"  ></el-input>
          </el-form-item>
          <el-form-item label="当事人身份证号" >
            <el-input v-model="case_identify_report_data.tir_id_number"  ></el-input>
          </el-form-item>
        <el-form-item label="查获时间" >
          <el-date-picker :disabled="true" v-model="case_identify_report_data.date_of_filing" type="datetime" placeholder="选择案发日期" value-format="YYYY-MM-DD HH:mm:ss">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="送检时间" >
          <el-date-picker v-model="case_identify_report_data.staff_evi_send_time" type="datetime" placeholder="选择送检日期" value-format="YYYY-MM-DD HH:mm:ss">
          </el-date-picker>
        </el-form-item>

          <el-form-item label="送检人员" >
            <el-select v-model="case_identify_report_data.staff_evi_send_per"
                       filterable placeholder="请选择承办人" >
              <el-option
                      v-for="item in staff_Data"
                      :key="item.staff_id"
                      :label="item.staff_name"
                      :value="item.staff_id"
              ></el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="送检人员" >
            <el-select v-model="case_identify_report_data.staff_evi_send_per2"
                       filterable placeholder="请选择承办人" >
              <el-option
                      v-for="item in staff_Data"
                      :key="item.staff_id"
                      :label="item.staff_name"
                      :value="item.staff_id"
              ></el-option>
            </el-select>
          </el-form-item>


        <el-form-item label="送检单位" >
          <el-select v-model="case_identify_report_data.staff_evi_send_unit"
                      filterable placeholder="请选择送检单位" >
            <el-option
                v-for="item in unit_Data"
                :key="item.work_unit_id"
                :label="item.work_unit_name"
                :value="item.work_unit_name"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <el-table :data="evidence_ciga_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header">
        <el-table-column prop="evi_id_number" label="保存通知书编号"  align="center" width="150"></el-table-column>
        <el-table-column prop="ciga_variety" label="烟草种类"  align="center"></el-table-column>
        <el-table-column prop="ciga_model" label="烟草规格"  align="center"></el-table-column>
        <el-table-column prop="evi_number" label="烟草数量"  align="center"></el-table-column>
      </el-table>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="Post_identify_Visible = false">取 消</el-button>
          <el-button type="success" @click="certern_Post_report">送 检</el-button>
				</span>
      </template>
    </el-dialog>


    <el-dialog title="鉴定卷烟" v-model="Get_identify_Visible" width="39%">
      <el-form label-width="140px">
        <el-form-item label="商户信息" >
          商户名称： {{case_identify_report_data.mer_name}}<br>
          负责人：    {{case_identify_report_data.mer_person}}<br>
          售卖许可证：{{case_identify_report_data.retail_licence_code}}<br>
        </el-form-item>
        <el-form-item label="鉴别人员1" >
          <el-select v-model="case_identify_report_data.staff_evi_check_per1"
                     clearable filterable placeholder="请选择鉴别人员1" >
            <el-option
                v-for="item in staff_Data"
                :key="item.staff_id"
                :label="item.staff_name"
                :value="item.staff_id"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="鉴别人员2" >
          <el-select v-model="case_identify_report_data.staff_evi_check_per2"
                     clearable filterable placeholder="请选择鉴别人员2" >
            <el-option
                v-for="item in staff_Data"
                :key="item.staff_id"
                :label="item.staff_name"
                :value="item.staff_id"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="鉴别时间" >
          <el-date-picker v-model="case_identify_report_data.staff_evi_identity_time" type="datetime" placeholder="选择鉴别日期" value-format="YYYY-MM-DD HH:mm:ss">
          </el-date-picker>
        </el-form-item>
      </el-form>
      <el-table :data="evidence_ciga_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header">
        <el-table-column prop="evi_id_number" label="保存通知书编号"  align="center" width="150"></el-table-column>
        <el-table-column prop="ciga_variety" label="烟草种类"  align="center"></el-table-column>
        <el-table-column prop="ciga_model" label="烟草规格"  align="center"></el-table-column>
        <el-table-column prop="evi_number" label="烟草数量"  align="center"></el-table-column>
        <el-table-column prop="ciga_type" label="烟草类型"  align="center">
          <template #default="scope">
            <el-select v-model="scope.row.ciga_type"
                       @change="update_evi_ciga(scope.row.evi_id,scope.row.ciga_type)"
                       filterable placeholder="请选择烟草类型" >
              <el-option key="1" label="真烟" value="真烟"></el-option>
              <el-option key="2" label="假烟" value="假烟"></el-option>
            </el-select>
          </template>
        </el-table-column>
      </el-table>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="Get_identify_Visible = false">取 消</el-button>
          <el-button type="primary" @click="views_identify_report_vie">预 览</el-button>
          <el-button type="primary" @click="create_report_word">打 印</el-button>
					<el-button type="primary" @click="edit_post_record_data">修 改</el-button>
          <el-button type="success" @click="certern_Get_report">完 成</el-button>
				</span>
      </template>
    </el-dialog>

    <el-dialog title="卷烟产品鉴别检验抽样单" v-model="Cigarette_identification_Visible" width="60%">
      <el-form ref="form"  :model="form" label-width="100px">

        <el-row>
          <el-col :span="12">
            <el-form-item label="当事人">
              <el-input v-model="cigarette_identifify_sample_data.tir_person" ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="当事人电话">
              <el-input v-model="cigarette_identifify_sample_data.tir_telephone"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="当事人地址">
          <el-input v-model="cigarette_identifify_sample_data.tir_address"></el-input>
        </el-form-item>
        <el-row >

          <el-col :span="12">
            <el-form-item label="抽样单位">
              <el-input v-model="cigarette_identifify_sample_data.sampling_unit"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="委托人">
              <el-input v-model="cigarette_identifify_sample_data.client"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row >
          <el-col :span="8">
            <el-form-item label="抽样人" >
              <el-select v-model="cigarette_identifify_sample_data.sampling_person1"  clearable filterable placeholder="请选择">
                <el-option
                        v-for="item in staff_Data"
                        :key="item.staff_id"
                        :label="item.staff_name"
                        :value="item.staff_id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="抽样人">
              <el-select v-model="cigarette_identifify_sample_data.sampling_person2"  clearable filterable placeholder="请选择">
                <el-option
                        v-for="item in staff_Data"
                        :key="item.staff_id"
                        :label="item.staff_name"
                        :value="item.staff_id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item  label="抽样时间">
              <el-date-picker v-model="cigarette_identifify_sample_data.sampling_time"  type="datetime" placeholder="选择抽样日期" value-format="YYYY-MM-DD HH:mm:ss">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="抽样地点">
          <el-input v-model="cigarette_identifify_sample_data.sampling_address"></el-input>
        </el-form-item>
        <el-row>
          <el-col :span="8">
            <el-form-item label="电话">
              <el-input v-model="cigarette_identifify_sample_data.telephone"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="邮编">
              <el-input v-model="cigarette_identifify_sample_data.postal_code"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="传真">
              <el-input v-model="cigarette_identifify_sample_data.portraiture"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="委托方地址">
          <el-input v-model="cigarette_identifify_sample_data.client_address"></el-input>
        </el-form-item>
      </el-form>
        <el-table :data="sample_ciga_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header">
          <el-table-column prop="name" label="样品名称"  align="center" width="150"></el-table-column>
          <el-table-column prop="s_address" label="生产单位" width="250" align="center"></el-table-column>
          <el-table-column prop="barcode" label="条形码"  align="center"></el-table-column>
          <el-table-column prop="package_form" label="包装形式" width="100" align="center"></el-table-column>
          <el-table-column prop="model" label="规格" width="80" align="center"></el-table-column>
            <el-table-column prop="base" label="样品基数" width="100" align="center"></el-table-column>
<!--          <el-table-column prop="ciga_type" label="抽样基数"  align="center"></el-table-column>-->
<!--          <el-table-column prop="ciga_type" label="样品数量"  align="center"></el-table-column>-->
        </el-table>

      <template #footer>
              <span class="dialog-footer">
                <el-button @click="Cigarette_identification_Visible= false" >取 消</el-button>
                <el-button @click="sample_message_preview">预览</el-button>
                <el-button @click="save_sample_message">保存抽样信息</el-button>
        <el-button color="#00a854" type="primary" @click="certain_sample_message">确 定</el-button>
              </span>
      </template>
    </el-dialog>


    <el-dialog title="卷烟产品鉴别检验委托协议书" v-model="Cigarette_identification_Entrust_Visible" width="60%">
      <el-form ref="form"  :model="form" label-width="100px">
        <div align="center"><h2>委托单位信息</h2></div><br>
        <el-row>
          <el-col :span="12">
            <el-form-item label="单位名称">
              <el-input disabled="true" v-model="cigarette_identifify_sample_data.unit_name" ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="邮编">
              <el-input v-model="cigarette_identifify_sample_data.postal_code"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="地址">
          <el-input v-model="cigarette_identifify_sample_data.sampling_address"></el-input>
        </el-form-item>
        <el-row >
          <el-col :span="8">
            <el-form-item label="联系人" >
              <el-select v-model="cigarette_identifify_sample_data.contact_person"  clearable filterable placeholder="请选择">
                <el-option
                        v-for="item in staff_Data"
                        :key="item.staff_id"
                        :label="item.staff_name"
                        :value="item.staff_id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系电话">
              <el-input v-model="cigarette_identifify_sample_data.telephone"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="传真">
              <el-input v-model="cigarette_identifify_sample_data.portraiture"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row >
          <el-col :span="8">
            <el-form-item label="抽样人" >
              <el-select v-model="cigarette_identifify_sample_data.sampling_person1_name" :disabled="true" clearable filterable placeholder="请选择">
                <el-option
                        v-for="item in staff_Data"
                        :key="item.staff_id"
                        :label="item.staff_name"
                        :value="item.staff_id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="抽样人">
              <el-select v-model="cigarette_identifify_sample_data.sampling_person2_name" :disabled="true"  clearable filterable placeholder="请选择">
                <el-option
                        v-for="item in staff_Data"
                        :key="item.staff_id"
                        :label="item.staff_name"
                        :value="item.staff_id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item  label="抽样时间">
              <el-date-picker :disabled="true" v-model="cigarette_identifify_sample_data.sampling_time"  type="datetime" placeholder="选择抽样日期" value-format="YYYY-MM-DD HH:mm:ss">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row >
          <el-col :span="16">
            <el-form-item label="查获单位">
              <el-input v-model="cigarette_identifify_sample_data.sampling_unit"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="经办人">
              <el-select v-model="cigarette_identifify_sample_data.handle_person"   clearable filterable placeholder="请选择">
                <el-option
                        v-for="item in staff_Data"
                        :key="item.staff_id"
                        :label="item.staff_name"
                        :value="item.staff_id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-form-item label="查获地点">
          <el-input v-model="cigarette_identifify_sample_data.tir_address"></el-input>
        </el-form-item>

        <div align="center"><h2>检验站信息</h2></div><br>
        <el-row >
          <el-col :span="12">
            <el-form-item label="单位名称">
              <el-input v-model="cigarette_identifify_sample_data.inspection_station_name"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="地址">
              <el-input v-model="cigarette_identifify_sample_data.inspection_station_address"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="联系电话">
              <el-input v-model="cigarette_identifify_sample_data.inspection_station_telephone"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="传真">
              <el-input v-model="cigarette_identifify_sample_data.inspection_station_portraiture"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="邮编">
              <el-input v-model="cigarette_identifify_sample_data.inspection_station_postcode"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="样品状态描述">
          <el-input v-model="cigarette_identifify_sample_data.sample_state_describe" type="textarea" rows="2"></el-input>
        </el-form-item>
        <el-form-item label="备注">
          <el-input v-model="cigarette_identifify_sample_data.remarks" type="textarea" rows="2"></el-input>
        </el-form-item>
      </el-form>
      <el-table :data="sample_ciga_Data" border class="table" ref="multipleTable" header-cell-class-name="table-header">
        <el-table-column prop="name" label="样品名称"  align="center" width="150"></el-table-column>
        <el-table-column prop="s_address" label="生产单位" width="250" align="center"></el-table-column>
        <el-table-column prop="barcode" label="条形码"  align="center"></el-table-column>
        <el-table-column prop="package_form" label="包装形式" width="100" align="center"></el-table-column>
        <el-table-column prop="model" label="规格" width="80" align="center"></el-table-column>
        <el-table-column prop="base" label="样品基数" width="100" align="center"></el-table-column>
        <!--          <el-table-column prop="ciga_type" label="抽样基数"  align="center"></el-table-column>-->
        <!--          <el-table-column prop="ciga_type" label="样品数量"  align="center"></el-table-column>-->
      </el-table>

      <template #footer>
              <span class="dialog-footer">
                <el-button @click="Cigarette_identification_Entrust_Visible= false" >取 消</el-button>
                <el-button @click="sample_entrust_message_preview">预览</el-button>
                <el-button @click="save_extrust_message">保存抽样信息</el-button>
        <el-button color="#00a854" type="primary" @click="certain_sample_entrust_message">确 定</el-button>
              </span>
      </template>
    </el-dialog>


    <!--    //查看卷烟鉴别书-->
    <el-dialog title="" v-model="View_identify_Visible" width="34%">
      <html>
      <head>
        <title>卷烟产品鉴别书</title>
      </head>
      <body>
      <h1 align="center">
        福建省闽侯县烟草专卖局
      </h1>
      <h2 align="center">
        卷烟产品鉴别书
      </h2>
      <table border="1"  style="border-collapse: collapse;" width="100%">
        <tr>
          <th colspan="1" width="15%">当事人</th>
          <th colspan="1">{{case_identify_report_data.tir_person}}</th>
          <th colspan="1">身份证号码</th>
          <th colspan="1">{{case_identify_report_data.tir_id_number}}</th>
        </tr>
        <tr>
          <th colspan="1">查获时间</th>
          <th colspan="1">{{case_identify_report_data.year}}年{{case_identify_report_data.month}}月{{case_identify_report_data.day}}日</th>
          <th colspan="1">查获地点</th>
          <th colspan="1">{{case_identify_report_data.mer_address}}</th>
        </tr>
        <tr>
          <th colspan="1">送检单位</th>
          <th colspan="1">{{case_identify_report_data.staff_evi_send_unit}}</th>
          <th colspan="1">送检时间</th>
          <th colspan="1">{{case_identify_report_data.year1}}年{{case_identify_report_data.month1}}月{{case_identify_report_data.day1}}日</th>
        </tr>
        <tr>
          <th colspan="1">送检人员</th>
          <th colspan="3">{{case_identify_report_data.staff_evi_send_per_name}}</th>
        </tr>
        <tr>
          <th colspan="1">卷烟来源情况及查获品牌和数量</th>
          <th colspan="3" align="left">
            &emsp;&emsp;<span >{{case_identify_report_data.year}}年{{case_identify_report_data.month}}月{{case_identify_report_data.day}}日</span>，
            我局专卖执法人员依法对位于<span >{{case_identify_report_data.mer_address}}</span>
            的<span >{{case_identify_report_data.mer_name}}</span>的当事人<span >{{case_identify_report_data.tir_person}}</span>
            出示执法检查证件表明身份后，对该店铺进行检查，并在卷烟柜台以及仓库内发现涉嫌违法的卷烟，品种数量如下：<span >{{case_identify_report_data.ciga_data_all}}</span>
            共计<span >{{case_identify_report_data.tce_type_number_chinese}}</span>品种<span >{{case_identify_report_data.tce_number_chinese}}</span>
            （证据先行登记保存通知书号：<span >{{ case_identify_report_data.evi_data_all }}</span>）。由于当事人无法提供该批卷烟的合法有效证明，
            涉嫌<span >{{case_identify_report_data.illegal_behavior_data}}</span>行为，为了保全证据，我局专卖执法人员对现场执法情况拍照留证，
            经报本局领导批准同意，我局专卖执法人员依法对上述卷烟予以先行登记保存，同时制作检查（勘验）笔录，交当事人<span >{{case_identify_report_data.tir_person}}</span>核对无异议后签字确认。
          </th>
        </tr>
        <tr>
          <th colspan="1">鉴别情况及鉴别结论</th>
          <th colspan="3"  align="left">
            我局卷烟真伪鉴别小组依据《烟草专卖品鉴别检验管理办法》【国烟科[2014]285号】；《卷烟产品鉴别检验规程》；
            GB5606.4-2005 卷烟 第4部分 感官技术要求，借助卷烟鉴别仪器，将上述卷烟与真品卷烟进行对照，
            对被鉴别卷烟的生产工艺、防伪标志等进行检查、识别、并经逻辑分析加以综合判定，鉴别结论如下：
            <span >{{case_identify_report_data.ciga_data_t}}</span>
            <span >{{case_identify_report_data.ciga_data_f}}</span>
          </th>
        </tr>
        <tr>
          <th colspan="1">真伪鉴别小组人员签名</th>
          <th colspan="2" align="left">{{case_identify_report_data.staff_evi_check_per_name_1}}{{case_identify_report_data.staff_identity_license_no_1}}<br>
            {{case_identify_report_data.staff_evi_check_per_name_2}}{{case_identify_report_data.staff_identity_license_no_1}}
          </th>
          <th colspan="1"> 鉴别日期：{{case_identify_report_data.year2}}年{{case_identify_report_data.month2}}月{{case_identify_report_data.day2}}日</th>
        </tr>
        <tr>
          <th colspan="1">当事人对上述鉴别结论是否有异议</th>
          <th colspan="3" align="left">
            {{case_identify_report_data.staff_evi_per_note}}
          </th>
        </tr>
        <tr>
          <th colspan="1">备注</th>
          <th colspan="3" align="left">
          </th>
        </tr>
      </table>
      </body>
      </html>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="View_identify_Visible = false">取 消</el-button>
          <el-button type="primary" @click="create_report_word">打 印</el-button>
				</span>
      </template>
    </el-dialog>


    <!--卷烟产品鉴别检验抽样单-->
    <el-dialog  v-model="View_identify_Sample_Visible" width="50%">
      <html>
      <head>
        <title>卷烟产品鉴别检验抽样单</title>
      </head>
      <body>
      <h1 align="center">
        卷烟产品鉴别检验抽样单
      </h1>
      <h2 align="right">
        JSJL-122
      </h2>
      <br>
      <table border="1"  style="border-collapse: collapse;" width="100%">
        <tr >
          <th colspan="1" width="25%" height="30px">当事人</th>
          <th colspan="1" width="25%" height="30px">{{cigarette_identifify_sample_data.tir_person}}</th>
          <th colspan="1" width="25%" height="30px">当事人电话</th>
          <th colspan="1" width="25%" height="30px">{{cigarette_identifify_sample_data.tir_telephone}}</th>
        </tr>
        <tr>
          <th colspan="1" height="30px">当事人地址</th>
          <th colspan="3" height="30px">{{cigarette_identifify_sample_data.tir_address}}</th>
        </tr>
        <tr>
          <th colspan="1" height="30px">抽样单位</th>
          <th colspan="1" height="30px">{{cigarette_identifify_sample_data.sampling_unit}}</th>
          <th colspan="1" height="30px">抽样人</th>
          <th colspan="1" height="30px">{{cigarette_identifify_sample_data.sampling_person1_name}}、{{cigarette_identifify_sample_data.sampling_person2_name}}</th>
        </tr>
        <tr>
          <th colspan="1" height="30px">抽样地点</th>
          <th colspan="1" height="30px">{{cigarette_identifify_sample_data.sampling_address}}</th>
          <th colspan="1" height="30px">抽样时间</th>
          <th colspan="1" height="30px">{{cigarette_identifify_sample_data.year}}年{{cigarette_identifify_sample_data.month}}月{{cigarette_identifify_sample_data.day}}日</th>
        </tr>
        <tr>
          <th colspan="1" height="30px">委托人</th>
          <th colspan="1" height="30px">{{cigarette_identifify_sample_data.client}}</th>
          <th colspan="1" height="30px">电话</th>
          <th colspan="1" height="30px">{{cigarette_identifify_sample_data.telephone}}</th>
        </tr>
        <tr>
          <th colspan="1" height="30px">传真</th>
          <th colspan="1" height="30px">{{cigarette_identifify_sample_data.portraiture}}</th>
          <th colspan="1" height="30px">邮编</th>
          <th colspan="1" height="30px">{{cigarette_identifify_sample_data.postal_code}}</th>
        </tr>
        <tr>
          <th colspan="1" height="30px">委托方地址</th>
          <th colspan="3" height="30px">{{cigarette_identifify_sample_data.client_address}}</th>
        </tr>
      </table>
      <table border="1" style="border-collapse: collapse;" width="100%" >
        <tr>
          <td align="center" width="14%" height="40px">样品名称</td>
          <td width="16%" align="center" height="30px">标注生产<br>单位(产地)</td>
          <td width="16%" align="center" height="30px">条盒<br>条形码</td>
          <td width="12%" align="center" height="30px">包装形式</td>
          <td width="12%" align="center" height="30px">规格</td>
          <td width="8%" align="center" height="30px">样品<br>基数</td>
          <td width="8%" align="center" height="30px">抽样<br>基数</td>
          <td width="12%" align="center" height="30px">样品数量</td>
        </tr>
      </table>
      <div v-for="item in sample_ciga_Data">
      <table border="1" style="border-collapse: collapse;" width="100%" >
        <tr >
          <td align="center"  width="14%" height="40px">{{item.name}}</td>
          <td width="16%" align="center" height="30px">{{item.s_address}}</td>
          <td width="16%" align="center" height="30px">{{item.barcode}}</td>
          <td width="12%" align="center" height="30px">{{item.package_form}}</td>
          <td width="12%" align="center" height="30px">{{item.model}}</td>
          <td width="8%" align="center" height="30px">{{item.base}}</td>
          <td width="8%" align="center" height="30px">1</td>
          <td width="12%" align="center" height="30px">1</td>
        </tr>
      </table>
      </div>
      </body>
      </html>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="View_identify_Sample_Visible = false">取 消</el-button>
          <el-button type="primary" @click="create_sample_message">打 印</el-button>
				</span>
      </template>
    </el-dialog>


    <!--卷烟产品鉴别检验委托协议书-->
    <el-dialog  v-model="View_identify_Sample_Entrust_Visible" width="55%">
      <html>
      <head>
        <title>卷烟产品鉴别检验抽样单</title>
      </head>
      <body>
      <h1 align="center">
        福建省烟草质量监督检测站
      </h1>
      <h1 align="center">
        卷烟产品鉴别检验委托协议书
      </h1>
      <div align="right">
        <font color="red">GLJL-00503</font>
      </div>
      <br>
      <table border="1"  style="border-collapse: collapse;" width="100%">
        <tr>
          <th rowspan="3" colspan="1" width="5.5%" height="30px">委托单位信息</th>
          <th  colspan="1" width="4%" height="30px">单位名称</th>
          <th colspan="6" width="30%" height="30px" >{{cigarette_identifify_sample_data.unit_name}}</th>
        </tr>
        <tr>
          <th colspan="1" height="30px">地址</th>
          <th colspan="3" height="30px" width="15%">{{cigarette_identifify_sample_data.client_address}}</th>
          <th colspan="1" height="30px">邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编</th>
          <th colspan="2" height="30px">{{cigarette_identifify_sample_data.postal_code}}</th>
        </tr>
        <tr>
          <th colspan="1" height="30px">联系人</th>
          <th colspan="1" height="30px" width="5%">{{cigarette_identifify_sample_data.contact_person_name}}</th>
          <th colspan="1" height="30px" width="8%">联系电话</th>
          <th colspan="1" height="30px" width="8%">{{cigarette_identifify_sample_data.telephone}}</th>
          <th colspan="1" height="30px">传&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;真</th>
          <th colspan="2" height="30px">{{cigarette_identifify_sample_data.portraiture}}</th>
        </tr>
        <tr>
          <th colspan="1" height="30px">抽样时间</th>
          <th colspan="1" height="30px">{{cigarette_identifify_sample_data.year}}.{{cigarette_identifify_sample_data.month}}.{{cigarette_identifify_sample_data.day}}</th>
          <th colspan="1" height="30px" width="4%">抽样人</th>
          <th colspan="1" height="30px" width="8%">{{cigarette_identifify_sample_data.sampling_person1_name}}、{{cigarette_identifify_sample_data.sampling_person2_name}}</th>
          <th colspan="1" height="30px">采样方式</th>
          <td colspan="1" height="30px" width="5%" align="center">□送样&nbsp;□寄样</td>
          <th colspan="1" height="30px">经办人</th>
          <th colspan="1" height="30px" width="5%">{{cigarette_identifify_sample_data.handle_person_name}}</th>
        </tr>
        <tr>
          <th colspan="1" height="30px">查获单位</th>
          <th colspan="3" height="30px">{{cigarette_identifify_sample_data.sampling_unit}}</th>
          <th colspan="1" height="30px">查获地点</th>
          <th colspan="4" height="30px" width="15%">{{cigarette_identifify_sample_data.tir_address}}</th>
        </tr>
        <tr>
          <th colspan="1" height="30px">客户</th>
          <th colspan="1" height="30px">检测方法</th>
          <td colspan="6" height="30px">《烟草专卖品鉴别检验管理办法》【国烟科[2014]285号】；<br>《卷烟产品鉴别检验规程》；<br>GB5606.4-2005 卷烟 第4部分 感官技术要求</td>
        </tr>
        <tr>
          <th colspan="1" height="30px">要求</th>
          <th colspan="1" height="30px">交付时间</th>
          <th colspan="6" height="30px">一般在7个工作日内交付检验报告，特殊情况由双方协商解决</th>
        </tr>
        <tr>
          <th colspan="1" height="30px">信息</th>
          <th colspan="1" height="30px" width="5.5%">检后样品处置</th>
          <th colspan="6" height="30px">□退样&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;□不退样</th>
        </tr>
      </table>
      <table border="1" style="border-collapse: collapse;" width="100%" >
        <tr>
          <td width="12.9%" align="center" height="30px">样品编号</td>
          <td align="center" width="14%" height="40px">样品名称</td>
          <td width="12%" align="center" height="30px">包装形式</td>
          <td width="12%" align="center" height="30px">规格<br>(mm)</td>
          <td width="16%" align="center" height="30px">标注生产单位<br>(产地)</td>
          <td width="16%" align="center" height="30px">条盒<br>条形码</td>
          <td width="8%" align="center" height="30px">样品数量</td>
      <td width="12%" align="center" height="30px">查获数量</td>

        </tr>
      </table>
      <div v-for="item in sample_ciga_Data">
        <table border="1" style="border-collapse: collapse;" width="100%" >
          <tr >
            <td width="12.9%" align="center" height="30px"></td>
            <td align="center"  width="14%" height="40px">{{item.name}}</td>
            <td width="12%" align="center" height="30px">{{item.package_form}}</td>
            <td width="12%" align="center" height="30px">{{item.model}}</td>
            <td width="16%" align="center" height="30px">{{item.s_address}}</td>
            <td width="16%" align="center" height="30px">{{item.barcode}}</td>
            <td width="8%" align="center" height="30px">1</td>
            <td width="12%" align="center" height="30px">{{item.base}}</td>
          </tr>
        </table>
        <table border="1"  style="border-collapse: collapse;" width="100%">
          <tr>
            <th colspan="1" width="12.9%" height="30px">样品状态描述</th>
            <th colspan="7" height="60px">{{cigarette_identifify_sample_data.sample_state_describe}}</th>
          </tr>
          <tr>
            <th rowspan="2"  colspan="1" width="11.5%">检测站信息</th>
            <th  colspan="1" width="10%" height="40px">单位名称</th>
            <th colspan="3">{{cigarette_identifify_sample_data.inspection_station_name}}</th>
            <th  colspan="1" width="17%">地址</th>
            <th colspan="2" >{{cigarette_identifify_sample_data.inspection_station_address}}</th>
          </tr>
          <tr>
            <th  colspan="1" height="40px">联系电话</th>
            <th colspan="2" width="25%">{{cigarette_identifify_sample_data.inspection_station_telephone}}</th>
            <th  colspan="1" width="5%">传真</th>
            <th colspan="1" width="17%">{{cigarette_identifify_sample_data.inspection_station_portraiture}}</th>
            <th  colspan="1" width="15%">邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编</th>
            <th colspan="1" >{{cigarette_identifify_sample_data.inspection_station_postcode}}</th>
          </tr>
          <tr>
            <th colspan="1" width="12.9%" height="30px">备注</th>
            <th colspan="7" height="60px">{{cigarette_identifify_sample_data.remarks}}</th>
          </tr>
        </table>
      </div>
      </body>
      </html>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="View_identify_Sample_Entrust_Visible = false">取 消</el-button>
          <el-button type="primary" @click="create_sample_entrust_message">打 印</el-button>
				</span>
      </template>
    </el-dialog>
    <!-- 卷烟送检结果上传 -->
    <el-dialog title="卷烟送检结果上传" v-model="Inspection_result_Visible" width="30%">
      <el-form label-width="150px">
        <el-form-item label="填写时间">
          <el-date-picker  v-model="img_form_data.time"  type="datetime" placeholder="选择上传日期" value-format="YYYY-MM-DD HH:mm:ss">
          </el-date-picker>
        </el-form-item>

        <el-form-item label="点击上传送检结果" >
          <el-upload class="upload-demo"
                     action="#"
                     :limit=2
                     list-type="picture-card"
                     :on-change="handleChange"
                     :on-remove="handleRemove"
                     :on-preview="true"
                     :auto-upload="false"
                     :on-progress="true"
                     accept="bmp, jpg, png, gif, jpeg"
                     :show-file-list="true" >
            <el-icon class="el-icon--upload"><upload-filled /></el-icon>
          </el-upload>
        </el-form-item>
      </el-form>
      <template #footer>
  <span class="dialog-footer">
          <el-button @click="Inspection_result_Visible = false">取 消</el-button>
  <el-button type="primary" @click="certern_inspection_result">确 定</el-button>
  </span>
      </template>
    </el-dialog>

    <!--    //查看卷烟鉴别相关卷宗视图-->
    <el-dialog title="查看卷烟鉴别相关文件" v-model="View_cigarette_identify_Visible" width="34%">

      <div align="center">
        <el-button type="primary" @click="cigarette_identification_certificate">卷烟鉴别书</el-button>
        <el-button type="primary" @click="cigarette_identification_sampling">卷烟产品鉴别检验抽样单</el-button><br><br>
        <el-button type="primary" @click="cigarette_identification_entrust">卷烟产品鉴别检验委托协议书</el-button>
        <el-button type="primary" @click="cigarette_inspection_result">卷烟送检结果</el-button>
      </div>
      <br>

    </el-dialog>

    <el-dialog title="查看卷烟送检结果" v-model="View_cigarette_Inspection_result_Visible" width="36%">
      <div class="table-td" align="center">
      <el-image
              class="table-td-thumb"
              :src="img_form_data.img"
              :z-index="10"
              :preview-src-list="[img_form_data.img]"
              preview-teleported
      >
      </el-image>
      </div>
      <template #footer>
				<span class="dialog-footer">
					<el-button @click="View_cigarette_Inspection_result_Visible = false">取 消</el-button>
					<el-button type="primary" @click="View_cigarette_Inspection_result_Visible = false">确 定</el-button>
				</span>
      </template>
    </el-dialog>


  </div>
</template>

<script setup lang="ts" name="basetable">
import { ref, reactive } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import { Delete, Edit, Search, Plus } from '@element-plus/icons-vue';
import {
  case_evi_Create,
  case_evi_Views,
  case_legal_Create,
  ciga_evudence_Create,
  end_record_data,
  evi_Views,
  fetchData_case,
  fetchData_case_Create,
  fetchData_case_update,
  fetchData_legal_clause,
  fetchData_mer,
  fetchData_s_mongodb_evidence_Cre,
  fetchData_s_mongodb_evidence_Views,
  fetchData_tobacco,
  fetchData_user,
  illegal_record_data,
  illegal_record_Search,
  mer_Create,
  mer_search_api,
  review_price_data,
  staff_evidence_create,
  staff_evidence_data,
  end_record_show,
  record_inquiry_show,
  record_inquiry_print,
  case_evidence_Views,
  case_evidence_Edit,
  illegal_record_update,
  edit_ille_record,
  end_record_update,
  update_staff_evidence_data,
  staff_unit_data,
  evi_ciga_type_update,
  identify_ciga_data,
  judge_whether_send_inspection,
  post_cigarette_indentify,
  sample_all_data,
  save_sample_relate_message,
  sample_people_time_data,
  sample_person_time_data,
  sample_entrust_data,
  save_entrust_relate_message,
  get_entrust_staff_name,
  fetchData_time_upload,
  sample_data_staff_time,
  entrust_inspection_station_data
} from '../api/index';
import {
  export_word_1, export_word_3, export_word_4, export_word_5, export_word_7,export_word_22,export_word_23
} from './table_inquiry.vue'



//案件表数据
interface TableItem {
  case_id:number,
  date_of_filing:string,
  date_of_closing:string,
  date_of_archive:string,
  case_source:string,
  case_number:string,
  archive_person:string,
  case_update_time:string,
  ase_type:string,
  case_remark:string,
  tcs_note_id:string,
  ciga_flag:string,
  ciga_num_flag:string,
  mer_flag:string,
}

//获取单位数据用作选项框
interface unit_data {
  work_unit_id: number,
  work_unit_address: string,
  work_unit_name: string,
}
const unit_Data = ref<unit_data[]>([]);
const get_unin_opinion = (work_unit_id: number,work_unit_name: string) =>{
  staff_unit_data(work_unit_id,work_unit_name).then(res=>{
    unit_Data.value = res.data.data;
  })
}
get_unin_opinion();

//获取商户数据用作选项框
interface mer_data {
  mer_id: number,
  mer_format: string,
  mer_address: string,
  mer_person: string,
  mer_record: string,
  date_of_record: string,
  date_of_effect: string,
  date_of_issue: string,
  mer_hometown: string,
  mer_id_number: string,
  mer_tel: string,
  business_licence_code: string,
  licence_state: string,
  storage_address: string,
  retail_licence_code: string,
  category: string,
  area_id: number,
  mer_zip_code: number,
  mer_name: string,
}
const mer_Data = ref<mer_data[]>([]);
const get_mer_opinion = (mer_name:string='',licence_state:string='',mer_person:string='' ,mer_id:number,business_licence_code:string='') =>{
  fetchData_mer(mer_name,licence_state,mer_person,mer_id,business_licence_code).then(res =>{
    mer_Data.value = res.data.data;
  })
}
get_mer_opinion();
//获取执法人员数据作为选择框
interface staff_data{
  staff_id:number,
  staff_name:string,
  staff_gender:string,
  staff_birthday:string,
  staff_ethnicity:string,
  staff_edu_bg:string,
  staff_email:string,
  field_staff_identity_card:string,
  staff_hometown:string,
  staff_degree:string,
  staff_political_status:string,
  staff_post:string,
  staff_account_no:string,
  staff_account_pwd:string,
  staff_starting_time:string,
  staff_authorized:string,
  staff_phone:string,
  staff_tel:string,
  staff_e_sign:string,
  staff_small_number:string,
  staff_license_no:string,
  staff_now_work_degree:string,
  staff_now_evaluate_degree:string,
}
const staff_Data = ref<staff_data[]>([]);
const get_staff_opinion1 = () =>{
  fetchData_user('','','').then(res=>{
    staff_Data.value = res.data.data;
  })
}
get_staff_opinion1();

//获取案由信息数据用作选项框
interface illegal_data {
  tlc_id:number,
  illegal_behavior:string,
  standard:string,
  penalty_range:string,
  statutory_penalty:string,
  grade:string,
  remark:string,
}
const illegal_Data = ref<illegal_data[]>([]);
const get_legal_clause_opinion = (illegal_behavior:string='',standard:string='' ,grade:string='',tlc_id:number) =>{
  fetchData_legal_clause(illegal_behavior, standard,grade,tlc_id).then(res =>{
    illegal_Data.value = res.data.data;
  })
}
get_legal_clause_opinion();


//视图/
const Post_identify_Visible = ref(false);                               //送检视图
const Get_identify_Visible = ref(false);                               //鉴定视图
const View_identify_Visible = ref(false);                               //查看鉴定表视图
const Cigarette_identification_Visible=ref(false);                            //卷烟抽样检测视图
const View_identify_Sample_Visible=ref(false);                                //卷烟产品鉴别检验抽样单视图
const Cigarette_identification_Entrust_Visible=ref(false);                        //卷烟鉴别委托书填写视图
const View_identify_Sample_Entrust_Visible=ref(false);                                //卷烟产品卷烟产品鉴别检验委托协议书视图
const Inspection_result_Visible=ref(false);                                    //上传送检结果
const View_cigarette_identify_Visible=ref(false);                               //卷烟鉴别相关卷宗
const View_cigarette_Inspection_result_Visible=ref(false);                          //查看卷烟送检结果

//通过案件号查询所有证据先行保存通知书
interface Evidence_case_data {
  case_id:number,//案件号
  evi_id_number:string,
  evi_number:number,
  tce_time_year:string,//案件时间
  tce_time_month:string,
  tce_time_day:string,
  tce_type_number:string,
  tce_number:string,
  tce_amount:number,
  tce_remark:string,
  tce_address:string,
}
const evidence_case_Data= ref<Evidence_case_data[]>([]);
const get_evidence_case_Data = (case_id:number) =>{
  case_evi_Views("" ,case_id).then(res=>{
    evidence_case_Data.value = res.data.data;
  })
}

// 打印报告书
const create_report_word = () =>{
  export_word_4(
      case_identify_report_data.year,
      case_identify_report_data.staff_evi_send_unit,
      case_identify_report_data.staff_evi_send_per_name,
      case_identify_report_data.staff_evi_check_per_name_1,
      case_identify_report_data.staff_evi_check_per_name_2,
      case_identify_report_data.staff_identity_license_no_1,
      case_identify_report_data.staff_identity_license_no_2,
      case_identify_report_data.staff_evi_per_note,
      case_identify_report_data.case_source,
      case_identify_report_data.month,
      case_identify_report_data.day,
      case_identify_report_data.hour,
      case_identify_report_data.ciga_data_t,
      case_identify_report_data.ciga_data_f,
      case_identify_report_data.tir_person,
      case_identify_report_data.tir_id_number,
      case_identify_report_data.mer_address,
      case_identify_report_data.mer_person,
      case_identify_report_data.retail_licence_code,
      case_identify_report_data.area_name,
      case_identify_report_data.mer_name,
      case_identify_report_data.list2,
      case_identify_report_data.tce_type_number_chinese,
      case_identify_report_data.tce_number_chinese,
      case_identify_report_data.list3,
      case_identify_report_data.year1,
      case_identify_report_data.month1,
      case_identify_report_data.day1,
      case_identify_report_data.year2,
      case_identify_report_data.month2,
      case_identify_report_data.day2,
  );
}

interface Evidence_ciga_data {
  evi_id:number,
  case_id:number,
  evi_number:number,
  ciga_variety:string,
  barcode:string,
  ciga_model:string,
  ciga_price:number,
  evi_id_number:string,
}
const evidence_ciga_Data= ref<Evidence_ciga_data[]>([]);
// 暂存鉴别书数据
const case_identify_report_data = reactive({
  date_of_filing:'',
  tcs_note:'',
  area_id:'',
  case_id:0,
  tir_person: "",
  tir_id_number: "",
  tir_home:"",
  case_source: "",
  case_number: "",
  mer_id: 0 ,
  year: "",
  month: "",
  day: "",
  hour: "",
  min: "",
  staff_evi_rec_address:'',
  staff_evi_send_per:'',
  staff_evi_send_per2:'',
  staff_evi_check_per1:'',
  staff_evi_check_per2:'',
  staff_evi_send_per_name:'',
  staff_evi_send_per_name2:'',
  staff_evi_check_per_name_1:'',
  staff_evi_check_per_name_2:'',
  staff_evi_send_time:'',
  year1:'',
  month1:'',
  day1:'',
  year2:'',
  month2:'',
  day2:'',
  staff_identity_license_no_1:'',
  staff_identity_license_no_2:'',
  staff_evi_send_unit:'',
  staff_evi_per_note:'',
  staff_evi_identity_time:'',
  mer_address: "",
  mer_person: "",
  mer_id_number: "",
  mer_hometown: "",
  mer_name: "",
  retail_licence_code: "",
  area_name: "",
  tce_type_number: "",
  tce_type_number_chinese: "",
  tce_number: "",
  tce_amount: "",
  tce_number_chinese: "",
  tce_type_number_f: '',
  tce_number_f: '',
  tce_type_number_f_chinese: "",
  tce_number_f_chinese: "",
  tce_type_number_t: '',
  tce_number_t: "",
  tce_type_number_t_chinese: "",
  tce_number_t_chinese: "",
  list1:[],
  list2:[],
  list3:[],
  list4:[],
  list5:[],
  illegal_behavior_data : '',
  ciga_data_all : '',
  ciga_data_t : '',
  ciga_data_f : '',
  evi_data_all : '',
  evi_data_t : '',
  evi_data_f : '',
  evi_ciga_t:'',
  evi_ciga_f:'',
})
//获取立案报告表中的数据
const get_identity_report_data= (case_id:number) =>{
  case_identify_report_data.ciga_data_t = ""
  case_identify_report_data.ciga_data_f = ""
  case_identify_report_data.evi_data_all = ""
  case_identify_report_data.illegal_behavior_data = ""
  case_identify_report_data.ciga_data_all=""
  case_identify_report_data.case_id = case_id
  staff_evidence_data(case_id).then(res=>{
    case_identify_report_data.date_of_filing = res.data.data.date_of_filing;
    case_identify_report_data.tir_person = res.data.data.tir_person;
    case_identify_report_data.tir_id_number = res.data.data.tir_id_number;
    case_identify_report_data.tir_home = res.data.data.tir_home;
    case_identify_report_data.staff_evi_rec_address = res.data.data.staff_evi_rec_address;
    case_identify_report_data.staff_evi_send_per = res.data.data.staff_evi_send_per;
    case_identify_report_data.staff_evi_check_per1 = res.data.data.staff_evi_check_per1;
    case_identify_report_data.staff_evi_check_per2 = res.data.data.staff_evi_check_per2;
    case_identify_report_data.staff_evi_send_per_name = res.data.data.staff_evi_send_per_name;
    case_identify_report_data.staff_evi_check_per_name_1 = res.data.data.staff_evi_check_per_name_1;
    case_identify_report_data.staff_evi_check_per_name_2 = res.data.data.staff_evi_check_per_name_2;
    case_identify_report_data.staff_evi_send_time = res.data.data.staff_evi_send_time;
    case_identify_report_data.year1 = res.data.data.year1;
    case_identify_report_data.month1 = res.data.data.month1;
    case_identify_report_data.day1 = res.data.data.day1;
    case_identify_report_data.year2 = res.data.data.year2;
    case_identify_report_data.month2 = res.data.data.month2;
    case_identify_report_data.day2 = res.data.data.day2;
    case_identify_report_data.staff_identity_license_no_1 = res.data.data.staff_identity_license_no_1;
    case_identify_report_data.staff_identity_license_no_2 = res.data.data.staff_identity_license_no_2;
    case_identify_report_data.staff_evi_send_unit = res.data.data.staff_evi_send_unit;
    case_identify_report_data.staff_evi_per_note = res.data.data.staff_evi_per_note;
    case_identify_report_data.mer_id = res.data.data.mer_id;
    case_identify_report_data.year = res.data.data.year;
    case_identify_report_data.month = res.data.data.month;
    case_identify_report_data.day = res.data.data.day;
    case_identify_report_data.hour = res.data.data.hour;
    case_identify_report_data.min = res.data.data.min;
    case_identify_report_data.mer_address = res.data.data.mer_address;
    case_identify_report_data.mer_person = res.data.data.mer_person;
    case_identify_report_data.mer_id_number = res.data.data.mer_id_number;
    case_identify_report_data.mer_hometown = res.data.data.mer_hometown;
    case_identify_report_data.mer_name = res.data.data.mer_name;
    case_identify_report_data.retail_licence_code = res.data.data.retail_licence_code;
    case_identify_report_data.area_name = res.data.data.area_name;
    case_identify_report_data.tce_type_number = res.data.data.tce_type_number;
    case_identify_report_data.tce_type_number_chinese = res.data.data.tce_type_number_chinese;
    case_identify_report_data.tce_number = res.data.data.tce_number;
    case_identify_report_data.tce_number_chinese = res.data.data.tce_number_chinese;
    case_identify_report_data.tce_number_f = res.data.data.tce_number_f;
    case_identify_report_data.tce_number_f_chinese = res.data.data.tce_number_f_chinese;
    case_identify_report_data.tce_type_number_f = res.data.data.tce_type_number_f;
    case_identify_report_data.tce_type_number_f_chinese = res.data.data.tce_type_number_f_chinese;
    case_identify_report_data.tce_number_t  = res.data.data.tce_number_t ;
    case_identify_report_data.tce_number_t_chinese = res.data.data.tce_number_t_chinese;
    case_identify_report_data.tce_type_number_t = res.data.data.tce_type_number_t;
    case_identify_report_data.staff_evi_identity_time =  res.data.data.staff_evi_identity_time;
    case_identify_report_data.tce_type_number_t_chinese = res.data.data.tce_type_number_t_chinese;
    case_identify_report_data.area_id = res.data.data.area_id;
    case_identify_report_data.list1 = res.data.data.list1;
    case_identify_report_data.list2 = res.data.data.list2;
    case_identify_report_data.list3 = res.data.data.list3;
    case_identify_report_data.list4 = res.data.data.list4;
    case_identify_report_data.list5 = res.data.data.list5;
    // evidence_ciga_Data.value = res.data.data.list2
    //案由
    res.data.data.list1.forEach(function (item) {
      case_identify_report_data.illegal_behavior_data = case_identify_report_data.illegal_behavior_data + item.illegal_behavior + '、'
    });
    //所有烟草
    res.data.data.list2.forEach(function (item) {
      case_identify_report_data.ciga_data_all = case_identify_report_data.ciga_data_all + '“' + item.ciga_model + ' ' + item.ciga_variety +
          '“'+item.evi_number+'条，'
    });
    //所有证据先行保存通知书
    res.data.data.list3.forEach(function (item) {
      case_identify_report_data.evi_data_all = case_identify_report_data.evi_data_all + '侯烟存通字【'+ case_identify_report_data.year +'】第'+
          item.evi_id_number + '号、'
    });
    // 假

    res.data.data.list5.forEach(function (item) {
      case_identify_report_data.ciga_data_f = case_identify_report_data.ciga_data_f + '“' + item.ciga_model + ' ' + item.ciga_variety +
          '“'+item.evi_number+'条，'
    });
    if (case_identify_report_data.ciga_data_f !== ""){
      case_identify_report_data.ciga_data_f = case_identify_report_data.ciga_data_f + "共计" + case_identify_report_data.tce_type_number_f_chinese
          +"品种" + case_identify_report_data.tce_number_f_chinese + "与真品卷烟实物对照样品、技术资料对比存在显著差异，经鉴别为假冒注册商标且伪劣卷烟。"
    }

    // 真烟

    res.data.data.list4.forEach(function (item) {
      case_identify_report_data.ciga_data_t = case_identify_report_data.ciga_data_t + '“' + item.ciga_model + ' ' + item.ciga_variety +
          '“'+item.evi_number+'条，'
    });

    if (case_identify_report_data.ciga_data_t !== ""){
      case_identify_report_data.ciga_data_t = case_identify_report_data.ciga_data_t + "共计" + case_identify_report_data.tce_type_number_t_chinese
          +"品种" + case_identify_report_data.tce_number_t_chinese +"与真品卷烟实物对照样品、技术资料对比无显著差异，经鉴别为真品卷烟。"
    }
    }
  )
}
// 修改立案报告表中的信息
const edit_post_record_data = () =>{
  update_staff_evidence_data(case_identify_report_data.case_id,case_identify_report_data.mer_id,case_identify_report_data.date_of_filing,
      case_identify_report_data.case_source,  case_identify_report_data.tir_person,
      case_identify_report_data.tir_id_number,case_identify_report_data.case_number,case_identify_report_data.area_id,
      case_identify_report_data.staff_evi_rec_address,case_identify_report_data.staff_evi_send_per,case_identify_report_data.staff_evi_send_per2,case_identify_report_data.staff_evi_check_per1,
      case_identify_report_data.staff_evi_check_per2, case_identify_report_data.staff_evi_send_time,case_identify_report_data.staff_evi_identity_time ,
      case_identify_report_data.staff_evi_send_unit,case_identify_report_data.staff_evi_per_note).then(res=>{
    if (res.data.message === "success"){
      // ElMessage.success('修改成功');
      get_identity_report_data(case_identify_report_data.case_id);
    }else {

      ElMessageBox.confirm('修改失败', '提示', {
        type: 'warning'
      })
    }
  })
}
// 完成送检
const certern_Post_report = () =>{
  if(case_identify_report_data.tir_person.length==0){
    alert("请输入当事人姓名！")

  }else if(case_identify_report_data.tir_id_number.length==0){
    alert("请输入当事人身份证号！")
  }else if(case_identify_report_data.staff_evi_send_time.length==0){
    alert("请选择送检日期！")
  }else if(case_identify_report_data.staff_evi_send_per.length==0){
    alert("请选择送检人员！")
  }else if(case_identify_report_data.staff_evi_send_unit.length==0){
    alert("请选择送检单位！")
  }
  else{
    case_identify_report_data.tcs_note = "卷烟鉴别书已送检"
    edit_post_record_data();
    fetchData_case_update(case_identify_report_data.case_id,case_identify_report_data.tcs_note).then(res=>{
      if (res.data.message === "success"){
        ElMessage.success('操作成功');
        getData();
        Post_identify_Visible.value = false;
      }else {
        ElMessageBox.confirm('操作失败', '提示', {
          type: 'warning'
        })
      }
    })
  }
}

//卷烟鉴别抽样及委托书数据
const cigarette_identifify_sample_data=reactive({
  case_id:0,
  tir_person:'',
  tir_telephone:'',
  tir_address:'',
  sampling_unit:'闽侯县烟草专卖局',
  sampling_person1:'',
  sampling_person1_name:'',
  sampling_person2:'',
  sampling_person2_name:'',
  sampling_address:'闽侯县甘蔗街道滨城大道69号闽商财富中心一楼（闽侯县烟草专卖局）',
  sampling_time:'',
  client:'闽侯县烟草专卖局',//委托人
  telephone:'0591-62080093',
  portraiture:'0591-22066126',//传真
  postal_code:'350100',
  client_address:'闽侯县甘蔗街道滨城大道69号闽商财富中心一楼',
  year:'',
  month:'',
  day:'',
  unit_name:'福建省闽侯县烟草专卖局',
  contact_person:'',//联系人
  handle_person:'',//经办人
  inspection_station_name:'',//检验站名称
  inspection_station_address:'',//检验站地址
  inspection_station_telephone:'',//检验站联系电话
  inspection_station_portraiture:'',//检验站传真
  inspection_station_postcode:'',//检验站邮编
  sample_state_describe:'',//样品状态描述
  remarks:'',//备注
  contact_person_name:'',
  handle_person_name:'',
})

//抽样样品信息
interface Sample_ciga_data {
  sample_no:number,
  case_id:number,
  ciga_id:number,
  name:string,
  package_form:string,
  s_address:string,
  barcode:string,
  model:string,
  base:string,
  sampling_quantity:1,
  sample_number:1
}
const sample_ciga_Data= ref<Sample_ciga_data[]>([]);
const get_sample_data=()=>{
  sample_all_data(case_identify_report_data.case_id).then(res=>{
    cigarette_identifify_sample_data.tir_person=res.data.data.tir_person;
    cigarette_identifify_sample_data.tir_telephone=res.data.data.tir_telephone;
    cigarette_identifify_sample_data.tir_address=res.data.data.tir_address;
    // alert(res.data.data.sample_entrust_id)
    // if (cigarette_identifify_sample_data.temp.length>0){
    cigarette_identifify_sample_data.sampling_unit=res.data.data.sampling_unit;
    cigarette_identifify_sample_data.sampling_person1=res.data.data.sampling_person1;
    cigarette_identifify_sample_data.sampling_person2=res.data.data.sampling_person2;
    cigarette_identifify_sample_data.sampling_address=res.data.data.sampling_address;
    // cigarette_identifify_sample_data.sampling_time=res.data.data.sampling_time;
    cigarette_identifify_sample_data.client=res.data.data.client;
    cigarette_identifify_sample_data.telephone=res.data.data.telephone;
    cigarette_identifify_sample_data.portraiture=res.data.data.portraiture;
    cigarette_identifify_sample_data.postal_code=res.data.data.postal_code;
    cigarette_identifify_sample_data.client_address=res.data.data.client_address;
    //}
    sample_ciga_Data.value=res.data.data.sample_ciga_Data;
  })
}
const get_sample_entrust_data=()=>{
  sample_entrust_data(case_identify_report_data.case_id).then(res=>{
    cigarette_identifify_sample_data.sampling_time=res.data.data.sampling_time;
    cigarette_identifify_sample_data.sampling_person1_name=res.data.data.sampling_person1_name;
    cigarette_identifify_sample_data.sampling_person2_name=res.data.data.sampling_person2_name;
    cigarette_identifify_sample_data.inspection_station_name=res.data.data.inspection_station_name;
    cigarette_identifify_sample_data.inspection_station_address=res.data.data.inspection_station_address;
    cigarette_identifify_sample_data.inspection_station_telephone=res.data.data.inspection_station_telephone;
    cigarette_identifify_sample_data.inspection_station_portraiture=res.data.data.inspection_station_portraiture;
    cigarette_identifify_sample_data.inspection_station_postcode=res.data.data.inspection_station_postcode;
    cigarette_identifify_sample_data.sample_state_describe=res.data.data.sample_state_describe;
    cigarette_identifify_sample_data.year=res.data.data.year;
    cigarette_identifify_sample_data.month=res.data.data.month;
    cigarette_identifify_sample_data.day=res.data.data.day;
    cigarette_identifify_sample_data.remarks=res.data.data.remarks;
  })
}
const get_entrust_inspection_station_data=()=>{
  entrust_inspection_station_data(case_identify_report_data.case_id).then(res=>{
    cigarette_identifify_sample_data.inspection_station_name=res.data.data.inspection_station_name;
    cigarette_identifify_sample_data.inspection_station_address=res.data.data.inspection_station_address;
    cigarette_identifify_sample_data.inspection_station_postcode=res.data.data.inspection_station_postcode;
    cigarette_identifify_sample_data.inspection_station_portraiture=res.data.data.inspection_station_portraiture;
    cigarette_identifify_sample_data.inspection_station_telephone=res.data.data.inspection_station_telephone;
    cigarette_identifify_sample_data.contact_person_name=res.data.data.contact_person_name;
    cigarette_identifify_sample_data.handle_person_name=res.data.data.handle_person_name;
    cigarette_identifify_sample_data.remarks=res.data.data.remarks;
    cigarette_identifify_sample_data.sample_state_describe=res.data.data.sample_state_describe
  })
}


const certain_sample_message=()=>{
  if(cigarette_identifify_sample_data.sampling_person1.length==0 ||cigarette_identifify_sample_data.sampling_person2.length==0){
    alert("请选择抽样人")
  }else if(cigarette_identifify_sample_data.sampling_time.length==0){
    alert("请选择抽样时间")
  }else{
    case_identify_report_data.tcs_note="卷烟鉴别委托书填写开始"
    fetchData_case_update(case_identify_report_data.case_id,case_identify_report_data.tcs_note).then(res=>{
      if (res.data.message === "success"){
        save_sample_message_database(case_identify_report_data.case_id);
        Cigarette_identification_Visible.value = false;
        getData();
      }else {
        ElMessageBox.confirm('操作失败', '提示', {
          type: 'warning'
        })
      }
    })
  }
}

const create_sample_message=()=>{
  export_word_22(
          cigarette_identifify_sample_data.tir_person,
          cigarette_identifify_sample_data.tir_telephone,
          cigarette_identifify_sample_data.tir_address,
          cigarette_identifify_sample_data.sampling_unit,
          cigarette_identifify_sample_data.sampling_person1_name,
          cigarette_identifify_sample_data.sampling_person2_name,
          cigarette_identifify_sample_data.sampling_address,
          cigarette_identifify_sample_data.client,
          cigarette_identifify_sample_data.telephone,
          cigarette_identifify_sample_data.portraiture,
          cigarette_identifify_sample_data.postal_code,
          cigarette_identifify_sample_data.client_address,
          sample_ciga_Data.value,
          cigarette_identifify_sample_data.year,
          cigarette_identifify_sample_data.month,
          cigarette_identifify_sample_data.day
  )
}

const create_sample_entrust_message=()=>{
  alert("打印")
   export_word_23(
          cigarette_identifify_sample_data.client_address,
          cigarette_identifify_sample_data.postal_code,
          cigarette_identifify_sample_data.contact_person_name,
          cigarette_identifify_sample_data.telephone,
          cigarette_identifify_sample_data.portraiture,
          cigarette_identifify_sample_data.year,
          cigarette_identifify_sample_data.month,
          cigarette_identifify_sample_data.day,
          cigarette_identifify_sample_data.sampling_person1_name,
          cigarette_identifify_sample_data.sampling_person2_name,
          cigarette_identifify_sample_data.handle_person_name,
          cigarette_identifify_sample_data.sampling_unit,
          cigarette_identifify_sample_data.tir_address,
          // sample_ciga_Data.value,
          cigarette_identifify_sample_data.sample_state_describe,
          cigarette_identifify_sample_data.inspection_station_name,
          cigarette_identifify_sample_data.inspection_station_address,
          cigarette_identifify_sample_data.inspection_station_telephone,
          cigarette_identifify_sample_data.inspection_station_portraiture,
          cigarette_identifify_sample_data.inspection_station_postcode,
          cigarette_identifify_sample_data.remarks
  )
}





const cigarette_identifify_sample=(row:any)=>{
  case_identify_report_data.case_id=row.case_id;
  get_sample_data();
  Cigarette_identification_Visible.value=true;
}

const cigarette_identifify_entrust=(row:any)=>{
  case_identify_report_data.case_id=row.case_id;
  get_sample_data();
  get_sample_entrust_data();
  Cigarette_identification_Entrust_Visible.value=true;
}

const save_sample_message=(row:any)=>{
  if(cigarette_identifify_sample_data.sampling_person1.length==0 ||cigarette_identifify_sample_data.sampling_person2.length==0){
    alert("请选择抽样人")
  }else if(cigarette_identifify_sample_data.sampling_time.length==0){
    alert("请选择抽样时间")
  }else{
    save_sample_message_database(case_identify_report_data.case_id);
  }
}

const save_extrust_message=(row:any)=>{
  if(cigarette_identifify_sample_data.contact_person.length==0){
    alert("请选择联系人")
  }else if(cigarette_identifify_sample_data.handle_person.length==0){
    alert("请选择经办人")
  }else{
    sample_entrust_message_database(case_identify_report_data.case_id);
  }
}

const certain_sample_entrust_message=(row:any)=>{
  if(cigarette_identifify_sample_data.contact_person.length==0){
    alert("请选择联系人")
  }else if(cigarette_identifify_sample_data.handle_person.length==0){
    alert("请选择经办人")
  }else{
    case_identify_report_data.tcs_note="上传送检结果开始"
    fetchData_case_update(case_identify_report_data.case_id,case_identify_report_data.tcs_note).then(res=>{
      if (res.data.message === "success"){
        sample_entrust_message_database(case_identify_report_data.case_id);
        getData();
        Cigarette_identification_Entrust_Visible.value = false;
        // location.reload();
      }else {
        ElMessageBox.confirm('操作失败', '提示', {
          type: 'warning'
        })
      }
    })
  }

}


const save_sample_message_database=(case_id:number)=>{
  save_sample_relate_message(case_id,cigarette_identifify_sample_data.tir_person,cigarette_identifify_sample_data.tir_telephone,
          cigarette_identifify_sample_data.tir_address,cigarette_identifify_sample_data.sampling_unit,cigarette_identifify_sample_data.client,
          cigarette_identifify_sample_data.sampling_person1,cigarette_identifify_sample_data.sampling_person2,cigarette_identifify_sample_data.sampling_time,
          cigarette_identifify_sample_data.sampling_address,cigarette_identifify_sample_data.telephone,cigarette_identifify_sample_data.postal_code,
          cigarette_identifify_sample_data.portraiture,cigarette_identifify_sample_data.client_address).then(res=>{
          if (res.data.message === "success"){
            ElMessage.success('操作成功');
          }else {
            ElMessageBox.confirm('操作失败', '提示', {
              type: 'warning'
            })
          }
  })
}
const sample_entrust_message_database=(case_id:number)=>{
  save_entrust_relate_message(case_id, cigarette_identifify_sample_data.sampling_unit,cigarette_identifify_sample_data.postal_code,
          cigarette_identifify_sample_data.sampling_address,cigarette_identifify_sample_data.contact_person,cigarette_identifify_sample_data.telephone,
          cigarette_identifify_sample_data.portraiture,cigarette_identifify_sample_data.handle_person,cigarette_identifify_sample_data.tir_address,
          cigarette_identifify_sample_data.inspection_station_name,cigarette_identifify_sample_data.inspection_station_address,
          cigarette_identifify_sample_data.inspection_station_telephone,cigarette_identifify_sample_data.inspection_station_portraiture,
          cigarette_identifify_sample_data.inspection_station_postcode,cigarette_identifify_sample_data.sample_state_describe,cigarette_identifify_sample_data.remarks).then(res=>{
    if (res.data.message === "success"){
      ElMessage.success('操作成功');
    }else {
      ElMessageBox.confirm('操作失败', '提示', {
        type: 'warning'
      })
    }
  })
}


// 完成鉴别
const certern_Get_report = () =>{
  if(case_identify_report_data.staff_evi_check_per1.length==0){
    alert("请选择鉴别人员！")
  }else if(case_identify_report_data.staff_evi_check_per2.length==0){
    alert("请选择鉴别人员！")
  }else if(case_identify_report_data.staff_evi_identity_time.length==0){
    alert("请选择鉴别时间！")
  }else{
    judge_whether_send_inspection(case_identify_report_data.case_id).then(res=>{
      case_identify_report_data.tcs_note=res.data.data.tcs_note;
      post_cigarette_indentify(case_identify_report_data.case_id,case_identify_report_data.staff_evi_check_per1,case_identify_report_data.staff_evi_check_per2,
              case_identify_report_data.staff_evi_identity_time).then(res1=>{
        fetchData_case_update(case_identify_report_data.case_id,case_identify_report_data.tcs_note).then(res=>{
          if (res.data.message === "success"){
            ElMessage.success('操作成功');
            Get_identify_Visible.value = false;
            getData();
          }else {
            ElMessageBox.confirm('操作失败', '提示', {
              type: 'warning'
            })
          }
        })
      })
    })
  }
}

const sample_message_preview=()=>{
  if(cigarette_identifify_sample_data.sampling_person1.length==0 ||cigarette_identifify_sample_data.sampling_person2.length==0){
    alert("请选择抽样人")
  }else if(cigarette_identifify_sample_data.sampling_time.length==0){
    alert("请选择抽样时间")
  }else{
    get_sample_message_preview_data();
    View_identify_Sample_Visible.value=true;
  }
}

const sample_entrust_message_preview=()=>{
  if(cigarette_identifify_sample_data.contact_person.length==0){
    alert("请选择联系人")
  }else if(cigarette_identifify_sample_data.handle_person.length==0){
    alert("请选择经办人")
  }else{
    get_sample_entrust_staff_name();
    View_identify_Sample_Entrust_Visible.value=true;
  }
}

const get_sample_entrust_staff_name=()=>{
  get_entrust_staff_name(cigarette_identifify_sample_data.contact_person,cigarette_identifify_sample_data.handle_person).then(res=>{
    cigarette_identifify_sample_data.contact_person_name=res.data.data.contact_person_name;
    cigarette_identifify_sample_data.handle_person_name=res.data.data.handle_person_name;
  })
}

//获取抽样人和抽样时间等信息
const get_sample_message_preview_data=()=>{
  sample_people_time_data(cigarette_identifify_sample_data.sampling_person1,cigarette_identifify_sample_data.sampling_person2,
    cigarette_identifify_sample_data.sampling_time).then(res=>{
    cigarette_identifify_sample_data.sampling_person1_name=res.data.data.sampling_person1_name
    cigarette_identifify_sample_data.sampling_person2_name=res.data.data.sampling_person2_name
    cigarette_identifify_sample_data.year=res.data.data.year
    cigarette_identifify_sample_data.month=res.data.data.month
    cigarette_identifify_sample_data.day=res.data.data.day
  })
}

const upload_inspection_result=(row:any)=>{
  case_identify_report_data.case_id=row.case_id;
  img_form_data.case_number=row.case_number;
  Inspection_result_Visible.value=true;
}
const img_form_data = reactive({
  case_number: '',
  name:'',
  content:'',
  remark:'',
  img:'',
  time:'',
});
const img = [];
const handleChange = (file) =>{
  img.push(file);
}
const handleRemove = (file) =>{
  img.forEach(function (item,index,arr){
    if (item.name == file.name){
      img.splice(index,1)
    }
  })
}

const certern_inspection_result=()=>{
  var form = new FormData();
  form.append('format',img[0].raw.type)
  form.append("file",img[0].raw)
  form.append("case_number",img_form_data.case_number)
  form.append("name","卷烟送检结果")
  form.append("type","卷烟送检结果")
  fetchData_s_mongodb_evidence_Cre(form).then(res=>{
    if (res.data.message === "success"){
      ElMessage.success('卷烟送检结果上传完成');
      Inspection_result_Visible.value = false;
      case_identify_report_data.tcs_note = "卷烟鉴别书已完成"
      fetchData_case_update(case_identify_report_data.case_id,case_identify_report_data.tcs_note).then(res=>{
        if (res.data.message === "success"){
          //ElMessage.success('状态更新成功');
          getData();
        }else {
          ElMessageBox.confirm('状态更新失败', '提示', {
            type: 'warning'
          })
        }
      })
      fetchData_time_upload(case_identify_report_data.case_id,img_form_data.time).then(res=>{
        if (res.data.message === "success"){
          //ElMessage.success('状态更新成功');
          getData();
        }else {
          ElMessageBox.confirm('状态更新失败', '提示', {
            type: 'warning'
          })
        }
      })
      getData();
    }else {
      ElMessageBox.confirm('状态更新失败', '提示', {
        type: 'warning'
      })
    }
  })
}



//修改卷烟类型
const update_evi_ciga = (evi_id:number, ciga_type:string='') =>{
  evi_ciga_type_update(evi_id,ciga_type).then(res=>{
    if (res.data.message === "success"){
      ElMessage.success('操作成功');
      getData();
    }else {
      ElMessageBox.confirm('操作失败', '提示', {
        type: 'warning'
      })
    }
  })
}
// 查看立案报告表视图
const views_identify_report_vie = () =>{
  View_identify_Visible.value = true;
}

// 列表中的按钮
// 送检表
const post_ciga_report = (row:any) =>{
  case_identify_report_data.case_id = row.case_id;
  get_identify_ciga();
  get_identity_report_data(row.case_id);
  if (case_identify_report_data.staff_evi_send_per == ''){
    fetchData_user('','',localStorage.getItem('ms_username')).then(res=>{
      case_identify_report_data.staff_evi_send_per = res.data.data[0].staff_id
    })
  }
  Post_identify_Visible.value = true;
}
//鉴别
const get_ciga_report = (row:any) =>{
  case_identify_report_data.case_id = row.case_id
  get_identify_ciga();
  get_identity_report_data(row.case_id);
  Get_identify_Visible.value = true;
}
//查看
const view_ciga_report = (row:any) =>{
  case_identify_report_data.case_id = row.case_id;
  case_identify_report_data.case_number = row.case_number;
  View_cigarette_identify_Visible.value = true;
}

const cigarette_identification_certificate=()=>{
  get_identity_report_data(case_identify_report_data.case_id);
  View_identify_Visible.value=true;
}
const cigarette_identification_sampling=()=>{
  get_sample_data();
  // get_cigarette_identification_sampling_data(case_identify_report_data.case_id);
  get_sample_data_staff_time();
  View_identify_Sample_Visible.value=true;
}
const cigarette_identification_entrust=()=>{
  get_sample_data();
  get_sample_data_staff_time();
  get_entrust_inspection_station_data();
  View_identify_Sample_Entrust_Visible.value=true;
}
const cigarette_inspection_result=()=>{
  img_form_data.case_number = case_identify_report_data.case_number;
  fetchData_s_mongodb_evidence_Views(case_identify_report_data.case_number,"卷烟送检结果").then(res => {
    img_form_data.img=res.data.data[0].img
    console.log(img_form_data.img)
  });
  View_cigarette_Inspection_result_Visible.value=true;
}
const get_sample_data_staff_time=()=>{
  sample_data_staff_time(case_identify_report_data.case_id).then(res=>{
    cigarette_identifify_sample_data.sampling_person1_name=res.data.data.sampling_person1_name,
    cigarette_identifify_sample_data.sampling_person2_name=res.data.data.sampling_person2_name,
    cigarette_identifify_sample_data.year=res.data.data.year,
    cigarette_identifify_sample_data.month=res.data.data.month,
    cigarette_identifify_sample_data.day=res.data.data.day
  })
}





//获取送检卷烟信息
const get_identify_ciga=()=>{
  identify_ciga_data(case_identify_report_data.case_id).then(res=>{
    evidence_ciga_Data.value = res.data.data.ciga_data;
  })
}

const query = reactive({
  case_source:'',
  case_type:'',
  tcs_note_id:'',
  case_number:'',
  pageIndex: 1,
  pageSize: 10
});
const tableData = ref<TableItem[]>([]);
const tableList = ref<TableItem[]>([]); // 用于存放分页数据的列表
const pageTotal = ref(0);
const name = localStorage.getItem('ms_username');
// 获取表格数据
const getData = (archive_person:string='',case_id:number,case_source:string='',case_type:string='',case_number:string='',tcs_note_id:string='',name:string='') => {

  fetchData_case(archive_person,case_id,case_source,case_type,case_number,tcs_note_id,name).then(res => {
    tableData.value = res.data.data.filter((i: { tcs_note_id: string; }) =>(
            i.tcs_note_id =="立案报告表审核已完成" ||
            i.tcs_note_id =="卷烟鉴别书已完成" ||
            i.tcs_note_id =="涉案烟草价品核案表完成" ||
            i.tcs_note_id =="询问笔录已完成" ||
            i.tcs_note_id =="无证经营公示已完成" ||
            i.tcs_note_id=="卷烟鉴别书已送检"||
            i.tcs_note_id=="调查终结文书已完成"||
            i.tcs_note_id=="案件处理审批已开始"||
            i.tcs_note_id=="集体讨论已开始"||
            i.tcs_note_id=="集体讨论已完成"||
            i.tcs_note_id=="听证已开始"||
            i.tcs_note_id=="听证告知书已完成"||
            i.tcs_note_id=="听证已完成"||
            i.tcs_note_id=="案件处理审批已完成"||
            i.tcs_note_id=="行政处罚事先告知书确认完成"||
            i.tcs_note_id=="行政处罚事先告知书已完成"||
            i.tcs_note_id=="行政处罚决定书确认完成"||
            i.tcs_note_id=="行政处罚决定书已完成"||
            i.tcs_note_id=="行政罚款收据上传完成"||
            i.tcs_note_id=="行政罚款收据已完成"||
            i.tcs_note_id=="结案报告表已完成"||
            i.tcs_note_id=="已完成"||
            i.tcs_note_id=="卷烟鉴别抽样单填写开始"||
            i.tcs_note_id=="卷烟鉴别委托书填写开始"||
            i.tcs_note_id=="上传送检结果开始"
    )  )
    tableList.value = [];
    pageTotal.value = tableData.value.length || 50;
    // 根据页码确定下标位置
    const index: number = query.pageIndex * query.pageSize - query.pageSize;
    for (let i = index; i < index + query.pageSize; i++) {
      // 防止数组下标越界
      if (i <= tableData.value.length - 1) {
        tableList.value.push(tableData.value[i])
      } else {
        // 越界就不再循环
        break;
      }
    }
  });
};

getData('','','','','','',name);
// 查询操作
const handleSearch = (case_number:string='',tcs_note_id:string='',case_source:string='',case_type:string='') => {
  alert(case_source)
  getData('','',case_source,case_type,case_number,tcs_note_id,name);
};
// 分页导航
const handlePageChange = (val: number) => {
  query.pageIndex = val;
  getData('','','','','','',localStorage.getItem('ms_username'));
};



</script>

<style scoped>
.handle-box {
  margin-bottom: 20px;
}

/*:deep .el-select-dropdown{*/
/*  max-width: 243px;*/
/*}*/
/*:deep .el-select-dropdown__item{*/
/*  display: inline-block;*/
/*}*/
/*.el-select-dropdown__item span {*/
/*  min-width: 205px;*/
/*  display: inline-block;*/
/*}*/


.handle-select {
  width: 120px;
}

.handle-input {
  width: 300px;
}
.table {
  width: 100%;
  font-size: 14px;
}
.red {
  color: #ff0000;
}

:deep(.avatar){
  width: 100px;
  height: 100px;
}
.blue {
  color: rgba(0, 118, 252, 0.79);
}
.mr10 {
  margin-right: 10px;
}

.table-td-thumb {
  display: block;
  margin: auto;
  width: 500px;
  height: 500px;
}
.handle-box button{
  background-color: #00a854;
}
.dialog-footer button{
  background-color: #00a854;
  color:white;
}
/*.save_sample_message button{*/
/*  background-color: #00a854;*/
/*  color:white;*/
/*}*/
/*#inspect_record{*/
/*  position: relative;*/
/*  left: 0px;*/
/*  top: -20px;*/

/*}*/


/*#filing_report_review{*/
/*  position: relative;*/
/*  left: 0px;*/
/*  top: -22px;*/
/*}*/
</style>
